<cpanel include="../../config.php">

<?

/***************************************************************************
 *                                 pro_box_trapper.php
 *                            -------------------
 *   Begin                : Thursday, April 16, 2005
 *   Copyright            : (C) 2005 Point and Code
 *   Domain               : http://www.pointandcode.com/
 *   Email                : support@pointandcode.com
 *   Version              : 1.0.0
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$html_root_path = '../../';
$page_title = "Box Trapper";
include $root_path.'common.php';
include $root_path.'page_header.php';

$big_wadge_of_stuff = <<<EOFpacman
<cpanel BoxTrapper="accountmanagelist(manage.html)">
EOFpacman;


$array_of_accounts_with_junk = explode('</tr>', $big_wadge_of_stuff);

$array_of_accounts = array();
$i=0;

foreach($array_of_accounts_with_junk as $row) {

	$temp = explode('<td>', $row);
	$temp2 = explode('</td>', $temp[1]);
	$array_of_accounts[$i]['name'] = $temp2[0];
	
	$temp2 = explode('</td>', $temp[2]);
	$array_of_accounts[$i]['status'] = $temp2[0];

	$i++;
}

$template->set_filenames(array(
	'body' => $root_path.$template_path.'mail/pro_box_trapper.tpl')
);

$i = 0;
foreach ($array_of_accounts as $row) {

	if (!empty($row['name'])) {
		$template->assign_block_vars('boxtrapperrow', array(
			'ROWCLASS' => ($i%2) ? $template_cfg['class_row_1'] : $template_cfg['class_row_2'],
			'ACCOUNT' => $row['name'],
			'STATUS' => $row['status'],
			
			'U_ENABLE' => 'pro_box_trapper_status_done.php?account='.$row['name'].'&status=enable',
			'U_DISABLE' => 'pro_box_trapper_status_done.php?account='.$row['name'].'&status=disable',
			'U_CONFIG' => 'pro_box_trapper_config.php?account='.$row['name'],
			'U_MESSAGE_EDIT' => 'pro_box_trapper_messages.php?account='.$row['name'],
			'U_LIST_EDIT' => 'pro_box_trapper_lists.php?account='.$row['name'],

			'U_LOG' => 'pro_box_trapper_log.php?account='.$row['name'],
			'U_QUEUE' => 'pro_box_trapper_queue.php?account='.$row['name'],
			)
		);
		
		if (trim($row['status']) == 'disabled') {
			$template->assign_block_vars('boxtrapperrow.switch_disabled', array());
		} else {
			$template->assign_block_vars('boxtrapperrow.switch_enabled', array());
		};
	$i++;
	}
}


//
// Woohoo! All done!
//
$template->pparse('body');




include $root_path.'page_tail.php';




?>